/**
 * fshows.com
 * Copyright (C) 2013-2019 All Rights Reserved.
 */
package com.example.fardemo.jmh.counter.impl;

import com.example.fardemo.jmh.counter.ICounter;

import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.LongAdder;

/**
 * LongAdder计数器
 *
 * @author Liluqing
 * @version LongAdderCounter.java, v 0.1 2019-05-06 14:47
 */
public class LongAdderCounter implements ICounter {

    private LongAdder num = new LongAdder();

    @Override
    public void hit() {
        num.increment();
    }

    @Override
    public long getRequestSum() {
        return num.sum();
    }

    @Override
    public void close() {

    }
}